package app.test;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebView;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        WebView wv = (WebView) findViewById(R.id.webView);
        wv.getSettings().setJavaScriptEnabled(true);
        wv.loadUrl("file:///android_asset/pie_chart.html?value=@atilacamurca&array=[1,2,6,3,9,8,10,3]");
        
        // parameters
        /*try {
			List<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("values", "{1,2,3}"));
			HttpClient client = new DefaultHttpClient();
			HttpPost post = new HttpPost("file:///android_asset/pie_chart.html");
			post.setEntity(new UrlEncodedFormEntity(params, HTTP.UTF_8));

		} catch (Exception e) {
			e.printStackTrace();
			Log.e("http client error", e.getMessage());
		}*/
    }
}